import service from "@/utils/request.js";

// 检测用户token是否过期，是否还在登录状态
export function isLogin() {
	return service.get('/user/isLogin');
}

// 用户登录api
export function userLogin(data = {}) {
	return service.post('/user/login', data, {useFormEncoded:'json'});
}

// 用户注册
export function userRegister(data = {}) {
	return service.post('/user/register', data, {useFormEncoded:'json'});
}

// 用户个人信息
export function getUserInfo() {
	return service.get('/user/userInfo');
}
// 修改用户个人信息
export function editUserInfo(data) {
	return service.put('/user/editUserInfo', data, {useFormEncoded:'json'});
}

// 修改用户登录密码
export function editUserPasswd(data) {
	return service.put('/user/editUserPasswd', data, {useFormEncoded:'json'});
}

// 获取mine页面的展示信息
export function getUserAndCoupleInfo() {
	return service.get('/user/mineInfo');
}
// 获取情侣信息
export function getCoupleInfo() {
	return service.get('/user/coupleInfo');
}
// 根据用户账号获取用户信息
export function getUserInfoByAccount(account) {
	return service.get('/user/userInfo/'+account);
}

// 是否接受绑定请求
export function bindCoupleOption(data) {
	return service.post('/user/bindCouple', data, {useFormEncoded:'json'});
}
// 更改情侣信息
export function editCoupleInfo(data) {
	return service.put('/user/editCoupleInfo', data, {useFormEncoded:'json'})
}
// 获取用户账户余额
export function getUserBalance() {
	return service.get('/user/userBalance')
}
// 提交工资转换申请
export function commintWageConversion(data) {
	return service.post('/user/wageConversion', data, {useFormEncoded:'json'})
}

// 工资转换申请消息数
export function wageConversionMessageCount() {
	return service.get('/user/wageConversionMEssageCount')
}
// 工资转换申请消息
export function wageConversionMessage() {
	return service.get('/user/wageConversionMessage')
}

// 审批工资转换申请
export function editWageConversionMessage(data) {
	return service.put('/user/editWageConversionMessage', data, {useFormEncoded:'json'})
}